<template>
  <div class="q-pa-md q-gutter-md">
    <q-btn
      push
      color="teal"
      label="Toggle"
      @click="toggle"
    />

    <!-- using v-if so you can see the effect -->
    <q-img
      v-if="url !== null"
      :src="url"
      :ratio="1"
      class="q-mt-md"
      style="width: 150px"
      placeholder-src=""
    />
  </div>
</template>

<script>
export default {
  data () {
    return {
      url: null
    }
  },

  methods: {
    toggle () {
      this.url = this.url === null
        ? 'https://placeimg.com/500/300/nature?t=' + Math.random()
        : null
    }
  }
}
</script>
